import requests

# 发送 GET 请求获取网页内容
url = 'https://www.r2coding.com/#/'  # 替换为您要爬取的网站URL
response = requests.get(url)

# 设置响应的编码为 UTF-8
response.encoding = 'utf-8'

# 将网页源代码保存到文件
with open('output.html', 'w', encoding='utf-8') as f:
    f.write(response.text)

print("网页源代码已保存到 output.html 文件中。")

